<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib  prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="redis" uri="http://www.shopjsp.com/redisTag/functions" %>
<c:set var="basePath" value="${redis:getSysConfig('base_path_back')}"/>
<c:set var="srcPath" value="${redis:getSysConfig('sysFileVisitRoot_back')}"/>
<script type="text/javascript">
    /**
     * 查看规格详情
     */
    function detailInfo(id){
        $(".gzv").remove();
        $.ajax({
            type: "POST",
            dataType: "JSON",
            url: "${basePath}/back/specification/getSpecificationInfo.sjson",
            data: {specificationId:id},
            success: function(result){
                var data = JSON.parse(result.data);
                /**重置详情页中所有html展示信息**/
                resetDetailTable("ggzv");
                /**设置展示信息**/
                var shopProductType =data.shopProductType;
                $("#d_productTypeName").html(shopProductType.sortName);
                $("#d_name").html(data.specification.name);
                $("#d_notes").html(data.specification.notes);
                $("#d_sort").html(data.specification.sort);
                $("#d_productTypeId").val(data.specification.productTypeId);
                if(data.specification.type=="0"){
                    $("#d_type").html("文本");
                }else if(data.specification.type=="1"){
                    $("#d_type").html("图片");
                }
                var html = "<tr class='gzv'><td class='titlebg' colspan='2' align='center' style='font-weight:bold;'>排序号</td><td class='titlebg' colspan='2' align='center' style='font-weight:bold;' >规格值名称</td></tr>";
                for(var i=0;i<data.specificationValueList.length;i++){
                    html += "<tr class='gzv'>";
                    html += "<td colspan='2' align='center'>"+data.specificationValueList[i].sort+"</td><td colspan='2' align='center'>"+data.specificationValueList[i].name+"</td>";
                    html += "</tr>";
                }
                $("#ggzv").append(html);
            }
        });
    }

</script>

<!--详情模态框（Modal） -->
<div class="modal fade" id="detailModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" >
	<div class="modal-dialog" style="width:70%">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
				<h5 class="modal-title" id="myModalLabel">规格详情</h5>
			</div>
			<div class="modal-body">
				<table id="ggzv" align="center" class="addOrEditTable table table-bordered" style="width:100%;">

					<tr>
						<td colspan="4" class="titlebg" style="font-weight:bold;text-align: center;">规格信息</td>
					</tr>
					<tr>
						<td class="toright_td" style="width: 25%;">所属分类：</td>
						<td class="toleft_td" style="width: 25%;">
							<span id="d_productTypeName"></span>
						</td>
						<td class="toright_td" style="width: 25%;">规格名称：</td>
						<td class="toleft_td" style="width: 25%;">
							<span id="d_name"></span>
						</td>
					</tr>
					<tr>
						<td colspan="1" class="toright_td">规格备注：</td>
						<td colspan="3" class="toleft_td">
							<span id="d_notes"></span>
						</td>
					</tr>
					<tr>
						<td colspan="1" class="toright_td">排序号：</td>
						<td colspan="3" class="toleft_td">
							<span id="d_sort"></span>
						</td>
					</tr>
					<tr>
						<td colspan="4" class="titlebg" style="font-weight:bold;text-align: center;">规格值信息</td>
					</tr>

				</table>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
			</div>
		</div><!-- /.modal-content -->
	</div><!-- /.modal -->
</div>